package com.crm.quartz;

import com.crm.service.CustomerService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 查找流失客户 定时任务
 *
 * @author Administrator
 */
@Component
public class FindLossCustomerJob {

    @Resource
    private CustomerService customerService;

    /**
     * 每天凌晨2点定期执行
     *      每分钟执行一次：         0 0/1 * * * ?
     *      每天凌晨2点执行一次：     0 0 2 * * ?
     */
    @Scheduled(cron = "0 0/1 * * * ?")
    public void work() {
        customerService.checkCustomerLoss();
    }
}
